#ifndef CONVEXPOLYGON_H
#define CONVEXPOLYGON_H

#include "canvas1.h"
#include <list>

class ConvexPolygon
{
    public:
    ConvexPolygon(void); //constructor
    ConvexPolygon(list<Point2> &points); //constructor
    void set(list<Point2> &point); //setter for the whole polgon
    list<Point2> getPoints(void); //getter for the whole polygon
    int numSides(void); //getter for number of verices
    Point2 getPoint(int position); //getter for arbitrary point
    void appendPoint(Point2 &point); //add a point to the end
    void insertPoint(Point2 &point, int position); //insert a point anywhere
    void deletePoint(int position); //remove a point from anwhere
    void draw(void);
    void draw_linestrip(void);
	Point2 norm(Point2 tempP);
	float dot(Point2 tempP1, Point2 tempP2);

    protected:
    bool isPointOut(Point2 &point);
    bool isConvex(void);
    list<Point2> pointList;
    list<Point2>::iterator iter;
};

#endif /* CONVEXPOLYGON_H */
